//
//  GGZFBBusinessHeaderCell.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/4/2.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "GGZFBBusinessHeaderCell.h"
#import "GGAddtion.h"
#import "ZFBBusinessTypeModel.h"
@interface GGZFBBusinessHeaderCell ()
@property (nonatomic, weak)UIImageView *icon;
@property (nonatomic, weak)UILabel *name;
@end
@implementation GGZFBBusinessHeaderCell
-(instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}
- (void)setUI{
    UIImageView *icon = [[UIImageView alloc]initWithFrame:CGRectZero];
    self.icon = icon;
    [self.contentView addSubview:icon];
    
    UILabel *name = [[UILabel alloc]init];
    name.font = [UIFont systemFontOfSize:13];
    self.name = name;
    [self.name sizeToFit];
    [self.contentView addSubview:name];
    
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(27, 27));
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.contentView).offset(20);
    }];
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.icon.mas_bottom).offset(10);
        make.centerX.equalTo(self.contentView);
    }];
}
- (void)setModel:(ZFBBusinessTypeModel *)model{
    self.icon.image = [UIImage imageNamed:model.icon];
    self.name.text = model.name;
}
@end
